import 'leaflet-draw'
import $ from 'jquery'

$.extend(L.drawLocal,{
  draw: {
    toolbar: {
      actions: {
        title: 'Cancel drawing',
        text: '取消'
      },
      finish: {
        title: 'Finish drawing',
        text: '结束'
      },
      undo: {
        title: 'Delete last point drawn',
        text: '删除最后一点'
      },
      buttons: {
        polyline: '折线',
        polygon: '多边形',
        rectangle: '矩形',
        circle: '圆形',
        marker: '标记',
        circlemarker: '圆形标记'
      }
    },
    handlers: {
      circle: {
        tooltip: {
          start: 'Click and drag to draw circle.'
        },
        radius: 'Radius'
      },
      circlemarker: {
        tooltip: {
          start: '点击地图放置圆形标记'
        }
      },
      marker: {
        tooltip: {
          start: '点击地图放置标记'
        }
      },
      polygon: {
        tooltip: {
          start: 'Click to start drawing shape.',
          cont: 'Click to continue drawing shape.',
          end: '点击第一个点结束绘制'
        }
      },
      polyline: {
        error: '<strong>Error:</strong> shape edges cannot cross!',
        tooltip: {
          start: 'Click to start drawing line.',
          cont: 'Click to continue drawing line.',
          end: 'Click last point to finish line.'
        }
      },
      rectangle: {
        tooltip: {
          start: 'Click and drag to draw rectangle.'
        }
      },
      simpleshape: {
        tooltip: {
          end: 'Release mouse to finish drawing.'
        }
      }
    }
  },
  edit: {
    toolbar: {
      actions: {
        save: {
          title: 'Save changes',
          text: '保存'
        },
        cancel: {
          title: 'Cancel editing, discards all changes',
          text: 'Cancel'
        },
        clearAll: {
          title: 'Clear all layers',
          text: '清除全部'
        }
      },
      buttons: {
        edit: '编辑图层',
        editDisabled: '没有可编辑图层',
        remove: '删除图层',
        removeDisabled: '没有图层'
      }
    },
    handlers: {
      edit: {
        tooltip: {
          text: 'Drag handles or markers to edit features.',
          subtext: 'Click cancel to undo changes.'
        }
      },
      remove: {
        tooltip: {
          text: 'Click on a feature to remove.'
        }
      }
    }
  }
});
